from utils.mongo_tools import retrieve_all_mongo_values, update_mongo_value
from views.configs import HISTORY_PART_COLLECTION

history_part = retrieve_all_mongo_values({},collection_name=HISTORY_PART_COLLECTION)
for i in history_part:
    if 'imgUrl' in i.keys():
        del i['imgUrl']

    update_mongo_value(
        {"number": i['number']},
        {"$set": i},
        collection_name=HISTORY_PART_COLLECTION,
    )